const { Buffer } = require('buffer');

const HEADLEN = 16

let header = {
    len:5,
    id:1
}
const data = "aaaaa"

let headerStr = JSON.stringify(header)
const buf1 = Buffer.from(headerStr)
const buf2 = Buffer.from(data)
const buf3 = Buffer.concat([buf1,buf2])
console.log(buf3);
// console.log(buf1.toString().length);
console.log(buf3.slice(0,HEADLEN).toString());
console.log();
